package com.hzqy.persistence.dao.behaviorControl;

import java.util.List;
import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Repository;

import com.hzqy.persistence.dao.core.PersistenceDao;
import com.hzqy.web.vo.behaviorControl.IndustryGroupSchedulesVo;
import com.hzqy.web.vo.behaviorControl.IndustryOrgContentSchedulesVo;
import com.hzqy.web.vo.behaviorControl.IndustrySchedulesVo;

@Repository
public class BehaviorControlDao extends PersistenceDao<IndustrySchedulesVo, Integer>{
	protected final Logger LOG = LoggerFactory.getLogger(BehaviorControlDao.class);
	
	public Integer forcedSwitchingServeridListCount(IndustryOrgContentSchedulesVo industryOrgContentSchedulesVo) {
		return getSqlSession().selectOne(this.getNamespace() + "forcedSwitchingServeridListCount", industryOrgContentSchedulesVo);
	}

	public List<IndustryOrgContentSchedulesVo> forcedSwitchingServeridList(Map<String, Object> map) {
		return getSqlSession().selectList(this.getNamespace() + "forcedSwitchingServeridList", map);
	}
	
	public Integer onlineStatisticsListCount(Map<String, Object> map) {
		return getSqlSession().selectOne(this.getNamespace() + "onlineStatisticsListCount", map);
	}

	public List<IndustryOrgContentSchedulesVo> onlineStatisticsList(Map<String, Object> map) {
		return getSqlSession().selectList(this.getNamespace() + "onlineStatisticsList", map);
	}
	
	public int findGroupCount(IndustryGroupSchedulesVo industryGroupSchedulesVo) {
		String namespace = this.getNamespace();
		return getSqlSession().selectOne(namespace + "findGroupCount", industryGroupSchedulesVo);
	}
	
	public List<IndustryGroupSchedulesVo> findGroupList(Map<String,Object> map){
		String namespace = this.getNamespace();
		return getSqlSession().selectList(namespace + "findGroupList", map);
	}

	public int bingOrgServeridGroup(IndustryOrgContentSchedulesVo industryOrgContentSchedulesVo) {
		return getSqlSession().insert(this.getNamespace() + "bingOrgServeridGroup", industryOrgContentSchedulesVo);
	}

	public int deleteBindOrgServeridGroup(IndustryOrgContentSchedulesVo industryOrgContentSchedulesVo) {
		return getSqlSession().delete(this.getNamespace() + "deleteBindOrgServeridGroup", industryOrgContentSchedulesVo);
	}
	
	public int deleteGroup(int f_igs_id) {
		String namespace = this.getNamespace();
		return getSqlSession().update(namespace + "deleteGroup", f_igs_id);
	}
	
	public int insertGroupSchedules(IndustryGroupSchedulesVo industryGroupSchedulesVo) {
		return getSqlSession().insert(this.getNamespace() + "insertGroupSchedules", industryGroupSchedulesVo);
	}
	
	public int insertSchedules(IndustrySchedulesVo industrySchedulesVo) {
		return getSqlSession().insert(this.getNamespace() + "insertSchedules", industrySchedulesVo);
	}
	
	public IndustryGroupSchedulesVo selectGroupSchedules(int f_igs_id){
		String namespace = this.getNamespace();
		return getSqlSession().selectOne(namespace + "selectGroupSchedules", f_igs_id);
	}
	
	public List<IndustryGroupSchedulesVo> selectSchedulesList(IndustrySchedulesVo industrySchedulesVo){
		String namespace = this.getNamespace();
		return getSqlSession().selectList(namespace + "selectSchedulesList", industrySchedulesVo);
	}
	
	public int updateGroupSchedules(IndustryGroupSchedulesVo industryGroupSchedulesVo) {
		return getSqlSession().update(this.getNamespace() + "updateGroupSchedules", industryGroupSchedulesVo);
	}
	
	public int deleteSchedules(int f_is_igsId) {
		String namespace = this.getNamespace();
		return getSqlSession().delete(namespace + "deleteSchedules", f_is_igsId);
	}
	
	/**
	 * 批量删除
	 * @param industryOrgContentSchedulesVoList
	 * @return
	 */
	public int batchDeleteBindOrgServeridGroup(List<IndustryOrgContentSchedulesVo> industryOrgContentSchedulesVoList) {
		return getSqlSession().delete(this.getNamespace() + "batchDeleteBindOrgServeridGroup", industryOrgContentSchedulesVoList);
	}
	
	/**
	 * 批量绑定
	 * @param industryOrgContentSchedulesVoList
	 * @return
	 */
	public int batchBingOrgServeridGroup(List<IndustryOrgContentSchedulesVo> industryOrgContentSchedulesVoList) {
		return getSqlSession().insert(this.getNamespace() + "batchBingOrgServeridGroup", industryOrgContentSchedulesVoList);
	}

	public List<IndustryOrgContentSchedulesVo> onlineStatisticsExcelList(Map<String, Object> map) {
		return getSqlSession().selectList(this.getNamespace() + "onlineStatisticsExcelList", map);
	}
}
